﻿using System;
using SceneAssist;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;

namespace Studio
{
	// Token: 0x020005C4 RID: 1476
	public class StudioNode : PointerAction
	{
		// Token: 0x1700048C RID: 1164
		// (get) Token: 0x06002590 RID: 9616 RVA: 0x000DE5EC File Offset: 0x000DC7EC
		public Button buttonUI
		{
			get
			{
				return this.m_Button;
			}
		}

		// Token: 0x1700048D RID: 1165
		// (get) Token: 0x06002591 RID: 9617 RVA: 0x000DE5F4 File Offset: 0x000DC7F4
		public Image imageButton
		{
			get
			{
				if (this.m_ImageButton == null)
				{
					this.m_ImageButton = this.m_Button.image;
				}
				return this.m_ImageButton;
			}
		}

		// Token: 0x1700048E RID: 1166
		// (get) Token: 0x06002592 RID: 9618 RVA: 0x000DE620 File Offset: 0x000DC820
		public Text textUI
		{
			get
			{
				return this.m_Text;
			}
		}

		// Token: 0x1700048F RID: 1167
		// (get) Token: 0x06002593 RID: 9619 RVA: 0x000DE628 File Offset: 0x000DC828
		// (set) Token: 0x06002594 RID: 9620 RVA: 0x000DE638 File Offset: 0x000DC838
		public string text
		{
			get
			{
				return this.m_Text.text;
			}
			set
			{
				this.m_Text.text = value;
			}
		}

		// Token: 0x17000490 RID: 1168
		// (set) Token: 0x06002595 RID: 9621 RVA: 0x000DE648 File Offset: 0x000DC848
		public Color textColor
		{
			set
			{
				this.m_Text.color = value;
			}
		}

		// Token: 0x17000491 RID: 1169
		// (get) Token: 0x06002596 RID: 9622 RVA: 0x000DE658 File Offset: 0x000DC858
		// (set) Token: 0x06002597 RID: 9623 RVA: 0x000DE660 File Offset: 0x000DC860
		public bool select
		{
			get
			{
				return this.m_Select;
			}
			set
			{
				if (Utility.SetStruct<bool>(ref this.m_Select, value))
				{
					this.imageButton.color = ((!this.m_Select) ? Color.white : Color.green);
				}
			}
		}

		// Token: 0x17000492 RID: 1170
		// (get) Token: 0x06002598 RID: 9624 RVA: 0x000DE698 File Offset: 0x000DC898
		// (set) Token: 0x06002599 RID: 9625 RVA: 0x000DE6A8 File Offset: 0x000DC8A8
		public bool interactable
		{
			get
			{
				return this.m_Button.interactable;
			}
			set
			{
				this.m_Button.interactable = value;
			}
		}

		// Token: 0x17000493 RID: 1171
		// (get) Token: 0x0600259A RID: 9626 RVA: 0x000DE6B8 File Offset: 0x000DC8B8
		// (set) Token: 0x0600259B RID: 9627 RVA: 0x000DE6C8 File Offset: 0x000DC8C8
		public bool active
		{
			get
			{
				return base.gameObject.activeSelf;
			}
			set
			{
				if (base.gameObject.activeSelf != value)
				{
					base.gameObject.SetActive(value);
				}
			}
		}

		// Token: 0x17000494 RID: 1172
		// (set) Token: 0x0600259C RID: 9628 RVA: 0x000DE6E8 File Offset: 0x000DC8E8
		public UnityAction addOnClick
		{
			set
			{
				this.m_Button.onClick.AddListener(value);
			}
		}

		// Token: 0x0600259D RID: 9629 RVA: 0x000DE6FC File Offset: 0x000DC8FC
		public override void OnPointerEnter(PointerEventData eventData)
		{
			if (!this.interactable)
			{
				return;
			}
			base.OnPointerEnter(eventData);
		}

		// Token: 0x0600259E RID: 9630 RVA: 0x000DE714 File Offset: 0x000DC914
		public virtual void Awake()
		{
			StudioNode.ClickSound clickSound = this.clickSound;
			if (clickSound == StudioNode.ClickSound.OK)
			{
				this.addOnClick = delegate()
				{
					Assist.PlayDecisionSE();
				};
			}
		}

		// Token: 0x04002604 RID: 9732
		[SerializeField]
		protected Button m_Button;

		// Token: 0x04002605 RID: 9733
		[SerializeField]
		protected Image m_ImageButton;

		// Token: 0x04002606 RID: 9734
		[SerializeField]
		protected Text m_Text;

		// Token: 0x04002607 RID: 9735
		[SerializeField]
		protected StudioNode.ClickSound clickSound;

		// Token: 0x04002608 RID: 9736
		protected bool m_Select;

		// Token: 0x020005C5 RID: 1477
		protected enum ClickSound
		{
			// Token: 0x0400260B RID: 9739
			NoSound,
			// Token: 0x0400260C RID: 9740
			OK
		}
	}
}
